<?php
/**
 * 《命令行测试》控制器
 * 
 * @author 孙晓晔
 * @version $Id: t.php 419 2009-10-28 04:33:29Z sunxy $
 */

if (!defined('APP_ROOT')) define('APP_ROOT', dirname(__FILE__));
if (!defined('APP_INC')) define('APP_INC', APP_ROOT . '/../../inc/');
if (!defined('APP_LIB')) define('APP_LIB', APP_ROOT . '/../../lib/');

require_once(APP_ROOT . '/inc/config.php');
require_once(APP_LIB . 'Controller.class.php');

$controller = new Controller();
$controller->config = APP_ROOT . '/inc';

$controller->left_delimiter = "{[";
$controller->right_delimiter = "]}";

if (count($argv) >= 3) {
	$controller->import = APP_ROOT . '/lib/' . $argv[1] . '/';
	$_REQUEST['do'] = $argv[2];
} else {
	$controller->import = APP_ROOT . '/lib/';
	$_REQUEST['do'] = $argv[1];
}

$_REQUEST['_tec'] = $argv;

$controller->execute($_REQUEST);
?>
